<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.List" %>
<%@ page import="java.lang.reflect.Field" %>
<%@ page import="java.sql.*" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<%
    //获取项目路径 例如 http://localhost:8080/weinxinadmin/ 或者 http://www.xxx.com/weinxinadmin/
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    Date date = new Date();
    String strDateFormat = "yyyy-MM-dd HH:mm:ss";
    SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
    String nowDate = sdf.format(date);
    String username = request.getParameter("username");

    if(username==null){
        out.print("<script>alert('请先登入');location.href='login.jsp'</script>");
    }else {
        session.setAttribute("username",username);
    }

%>


<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>二手汽车管理系统后台</title>
    <link rel="stylesheet" href="${ctx}/static/layui/css/layui.css" media="all">
    <script src="${ctx}/static/layui/layui.js"></script>
    <script src="${ctx}/static/js/jquery-1.9.1.min.js"></script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header" style="background-color: rgb(30,159,255)">
        <div class="layui-logo" style="color: rgb(255,255,255);">二手汽车管理系统后台</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item">
                <h3 style="text-align: center;text-align: center">二手汽车管理系统后台</h3>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="${sessionScope.get("avatar")}" class="layui-nav-img">
                    ${sessionScope.get("username")}-admin
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="doLgin.jsp?state=222">退出登录</a>
                    </dd>
                </dl>

            </li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">

            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test" style="background-color: rgb(30,159,255)">


                    <li class="layui-nav-item">
                        <a href="javascript:;">用户管理</a>
                        <dl class="layui-nav-child">
                            <dd><a href="${ctx}/view/back/user/userList.jsp" target="tqmContent">用户列表</a></dd>
                            <dd><a href="${ctx}/view/back/user/userAdd.jsp" target="tqmContent">新增用户</a></dd>

                        </dl>
                    </li>

                <li class="layui-nav-item">
                    <a href="javascript:;">车辆管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="${ctx}/view/back/car/carList.jsp" target="tqmContent">车辆列表</a></dd>
                        <dd><a href="${ctx}/view/back/car/carAdd.jsp" target="tqmContent">新增车辆</a></dd>
                    </dl>
                </li>




                <li class="layui-nav-item">
                    <a href="javascript:;">车友圈管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="${ctx}/view/back/carcircle/carCircleList.jsp" target="tqmContent">车友圈列表</a></dd>
                        <dd><a href="${ctx}/view/back/carcircle/carCircleAdd.jsp" target="tqmContent">新增车友圈</a></dd>
                    </dl>
                </li>

                <li class="layui-nav-item">
                    <a href="javascript:;">留言管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="${ctx}/view/back/liuyan/liuyanList.jsp" target="tqmContent">留言信息列表</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <!-- 内容主体区域 -->
        <div style="padding: 0px;height: 100%;width: 100%;">
            <iframe src="${ctx}/view/back/user/userList.jsp" name="tqmContent"
                    style="border: 0px solid blue;height: 100%;width: 100%;scrolling:auto;">

            </iframe>
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        二手汽车管理系统后台 - 底部版权区域
    </div>
</div>

<script>
    //JavaScript代码区域
    layui.use('element', function () {
        var element = layui.element;

    });
</script>
</body>
</html>
